package main

import "fmt"

func main() {

	var a, b, c interface{} = "abc", 123, "a" + "b" + "c"
	fmt.Printf("%T\n", a)
	fmt.Printf("%T\n", b)
	fmt.Printf("%T\n", c)
	fmt.Println(a == b) // 类型不同
	fmt.Println(a == c) // 相同

	var x *int = nil
	var y *bool = nil
	var ix, iy interface{} = x, y
	var i interface{} = nil
	fmt.Printf("%T\n", x)
	fmt.Printf("%T\n", y)
	fmt.Printf("%T\n", ix)
	fmt.Printf("%T\n", iy)
	fmt.Printf("%T\n", i)
	fmt.Println(ix == iy) // 动态类型不同
	fmt.Println(ix == i)  // 类型不同
	fmt.Println(iy == i)  // 类型不同

	var s []int = nil
	i = s
	fmt.Printf("%T\n", i)

	fmt.Println(i == nil)

}

/*
string
int
string
false
true
*int
*bool
*int
*bool
<nil>
false
false
false
[]int
*/
